﻿using System;
using Script.Framework;

namespace Script.Net
{
    /// <summary>
    /// 客户端逻辑模块基类
    /// </summary>
    public abstract class HandlerBase
    {
        /// <summary>
        /// 接收消息
        /// </summary>
        public abstract void OnReceive(int subCode, Object value);

        /// <summary>
        /// 为了方便发消息
        /// </summary>
        /// <param name="areaCode"></param>
        /// <param name="eventCode"></param>
        /// <param name="message"></param>
        protected void Dispatch(int areaCode, int eventCode, object message)
        {
            MsgCenter.instance.Dispatch(areaCode, eventCode, message);
        }
    }
}